|
|
|
|
|
|
|
Listing 12.7 STATUS.ZIPSetting Up a Status Bar in Code |
|
|
|
|
|
|
|
|
.Panels(1).AutoSize = sbrSpring
'Add the current time display
.Panels.Add , , , sbrTime
End With
End Sub |
|
|
|
|
|
|
|
|
Figure 12.32
You can control your status bar by
setting properties of the Panel objects. |
|
|
|
|
|
|
|
|
The status bar is not the only control that you can use to monitor progress in your program. Many programs have some tasks that take a relatively long time, so you'll want the capability to provide users with a dynamic indication of the operation's progress. The ProgressBar control is ideal for this situation. For example, Microsoft Internet Explorer uses a progress bar to indicate the percentage completed of a file transfer operation. In this case, the progress bar lets you know two things: First, as long as the bar is changing, you know that the file transfer is progressing. Second, by looking at the progress bar, you have some idea how much time is left in the transfer operation. |
|
|
|
|
|
|
|
|
Setting Up the Progress Bar |
|
|
|
|
|
|
|
|
You can easily set up and use the ProgressBar control. As with other controls, you first draw the bar on your form. Then you need to set the bar's properties. Among the several properties that can influence the look of the progress bar, Height and Width are the key properties. A progress bar typically is many times wider than it is tall. In fact, Microsoft recommends (in the Help system) that you make the width of the bar at least 12 times the height. Figure 12.33 shows a typical progress bar. |
|
|
|
|
|
|
|
|
The Value property of the progress bar sets or retrieves how much of the progress bar appears filled in. If you compare a ProgressBar control to a thermometer, the Value property is like the temperature. Everything below the current temperature is filled with mercury, and the remaining area is blank. |
|
|
|
|
|